package yz;

/**
 * [面试题 16.11. 跳水板](https://leetcode-cn.com/problems/diving-board-lcci/)
 *
 * @Author yangz
 * @Date 2022/9/19 22:28
 */
public class LeetCode1611_DivingBoard {
    public int[] divingBoard(int shorter, int longer, int k) {
        if (k == 0) {
            return new int[0];
        }
        int[] array = new int[k + 1];
        if (shorter == longer) {
            return new int[]{shorter * k};
        }
        for (int i = 0; i <= k; i++) {
            array[i] = (k - i) * shorter + i * longer;
        }
        return array;
    }
}
